﻿using System.Security.AccessControl;

namespace DI_test;

public class AbstractOS : IOs
{
    private int slowed = 50;
    public string Company { get; set; }
    public string Name { get; set; }

    public AbstractOS(int slowed, string company, string name){
        this.slowed = slowed;
        this.Company = company;
        this.Name = name;
    }


    public void On()
    {
        Console.Write("hello, my");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.WriteLine(" friend!");
        Thread.Sleep(slowed);

        Console.Clear(); 

        Thread.Sleep(slowed);
        Console.WriteLine($"I am {this.Name}! I is dotter {this.Company}");

        Thread.Sleep(1000);
    }

    public void Off()
    {
        Console.Write("good by, my");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.Write(".");
        Thread.Sleep(slowed);
        Console.WriteLine(" friend!");

        Thread.Sleep(1000);
    }
}
